package io.github.wjehovah.yyn.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

import io.github.wjehovah.yyn.App;

/**
 * Created by wuyong on 15/8/6.
 */
public class Engine {

    public static class Http {
        //是否连接网络
        public static boolean getAliveNetWork() {
            boolean connected = false;
            ConnectivityManager manager = (ConnectivityManager) App.getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo networkInfo = manager.getActiveNetworkInfo();
            if (networkInfo != null) {
                connected = networkInfo.isConnected();
            }
            return connected;
        }
    }
}

